package io.aircraft.modules.wms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.aircraft.common.service.impl.CrudServiceImpl;
import io.aircraft.modules.wms.dao.CallbackRecordDao;
import io.aircraft.modules.wms.dto.CallbackRecordDTO;
import io.aircraft.modules.wms.entity.CallbackRecordEntity;
import io.aircraft.modules.wms.service.CallbackRecordService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 回调记录
 *
 * @author Cycle gengruyi01@163.com
 * @since 1.0.0 2022-11-08
 */
@Service
public class CallbackRecordServiceImpl extends CrudServiceImpl<CallbackRecordDao, CallbackRecordEntity, CallbackRecordDTO> implements CallbackRecordService {

    @Override
    public QueryWrapper<CallbackRecordEntity> getWrapper(Map<String, Object> params) {
        String contNo = (String) params.get("contNo");

        QueryWrapper<CallbackRecordEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(contNo), "cont_no", contNo);

        return wrapper;
    }
}